<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 
if(isset($_SERVER['HTTP_HOST']))
{
    $base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 'https' : 'http';
    $base_url .= '://'. $_SERVER['HTTP_HOST'];
    $base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
    
    // Base URI (It's different to base URL!)
    $base_uri = parse_url($base_url, PHP_URL_PATH);
    if(substr($base_uri, 0, 1) != '/') $base_uri = '/'.$base_uri;
    if(substr($base_uri, -1, 1) != '/') $base_uri .= '/';
}

else
{
    $base_url = 'http://localhost/';
    $base_uri = '/';
}

/*
|--------------------------------------------------------------------------
| File and Directory Modes
|--------------------------------------------------------------------------
|
| These prefs are used when checking and setting modes when working
| with the file system.  The defaults are fine on servers with proper
| security, but you may wish (or even need) to change the values in
| certain environments (Apache running a separate process for each
| user, PHP under CGI with Apache suEXEC, etc.).  Octal values should
| always be used to set the mode correctly.
|
*/
define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0666);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0777);

/*
|--------------------------------------------------------------------------
| File Stream Modes
|--------------------------------------------------------------------------
|
| These modes are used when working with fopen()/popen()
|
*/

define('FOPEN_READ', 							'rb');
define('FOPEN_READ_WRITE',						'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 		'wb'); // truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 	'w+b'); // truncates existing file data, use with care
define('FOPEN_WRITE_CREATE', 					'ab');
define('FOPEN_READ_WRITE_CREATE', 				'a+b');
define('FOPEN_WRITE_CREATE_STRICT', 			'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT',		'x+b');


/*
|--------------------------------------------------------------------------
| Portal Constants
|--------------------------------------------------------------------------
|
| Daftar konstanta yang dipake di portal
|
*/
define('BASE_URL', $base_url);
define('BASE_URI', $base_uri);
define('TEKS_HEADER', 'Sistem Informasi Kearsipan');
define('TEKS_FOOTER', '&copy; 2009 | Pengadilan Militer II - 09 Bandung');
define('BASE_TEMPLATE', $base_url.'templates/pta-kearsipan/');

/*
|--------------------------------------------------------------------------
| Admin Constants
|--------------------------------------------------------------------------
|
| Daftar konstanta yang dipake di modul administrasi
|
*/

define('GROUP_ADMIN',       1);
define('GROUP_OPERATOR',    3);
define('GROUP_MANAJEMEN',   4);
define('GROUP_LAINLAIN',    8);

define('USER_AKTIF',        1);
define('USER_NONAKTIF',     0);

define('VIEWER_EVERYBODY',  0);
define('VIEWER_GRUP',       1);
define('VIEWER_USER_TTT',   2);

/*
|--------------------------------------------------------------------------
| Upload Constants
|--------------------------------------------------------------------------
|
| Daftar konstanta yang dipake di proses upload
|
*/

define('BASE_UPLOAD_ARSIP', './uploads/arsip/');
define('UPLOAD_SIZE_MAKSIMUM',          '10240');	//10240 kB ~ 10MB
define('UPLOAD_ALLOWED_FILETYPE', 'doc|docx|xls|xlsx|ppt|pptx|pdf|gif|png|jpeg|jpg|bmp');


define('DISPOSISI',         1);
define('SURAT_KELUAR',      2);
define('SURAT_MoU',         3);
define('SISKUMDANG',        4);

define('KODE_SURAT',       'K01.06.4');

define('KABKOTA',         165);	//Kota Bandung

define('TGL_SEPARATOR',   '-');


define('TEKS_NEXT',        'Berikut');
define('TEKS_PREV',        'Sebelumnya');
define('ROW_PER_PAGE',     15);
define('NUM_EDGE_ENTRIES', '2');
define('ALWAYS_SHOW_NEXT', 'false');
define('ALWAYS_SHOW_PREV', 'false');

define('TIPE_JABATAN_STRUKTURAL',          1);
define('TIPE_JABATAN_FUNGSIONAL_AK',       2);
define('TIPE_JABATAN_FUNGSIONAL_NON_AK',   3);

define('TIPE_DIKLAT_STRUKTURAL',           1);
define('TIPE_DIKLAT_KEPEMIMPINAN',         2);
define('TIPE_DIKLAT_FUNGSIONAL',           3);
define('TIPE_DIKLAT_TEKNIS',               4);
define('TIPE_DIKLAT_LAINNYA',              5);

/* End of file constants.php */
/* Location: ./system/application/config/constants.php */